package java;

import java.util.Arrays;
import java.util.Scanner;

import org.omg.PortableInterceptor.SYSTEM_EXCEPTION;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String strChoice;
		String[] strDigits;
		int[] digits = null;
		while(sc.hasNextLine()){
			strChoice = sc.nextLine();
			int m = convertStr2Choice(strChoice);
			switch (m) {
			case 1:
				int n = Integer.parseInt(sc.nextLine());
				System.out.println(fib(n)+"");
				break;
			case 2:
				String line = sc.nextLine();
				strDigits = line.split(" ");
				//digits = 
				convertToIntDigits(strDigits);
				//Arrays.sort(digits);
				//Arrays.toString(digits);
				break;
			case 3:
				Arrays.sort(digits);
				int digit = Integer.parseInt(sc.nextLine());
				int pos = Arrays.binarySearch(digits, digit);
				if (pos<0) {
					System.out.println(-1);
				} 
				else {
					System.out.println(pos);
				}
				break;	
			case 4:
				int x = Integer.parseInt(sc.nextLine());
				for(int i=0;i<x;i++){
					String id = sc.nextLine();
					System.out.println(getBirthDate(id));
				}
				break;
			default:
				System.out.println("exit");
				return;
			}
		}
		
	}

private static int fib(int n) {
	if(n<=2)
    {
		return 1;
    }
    else
    {
        return fib(n-1)+fib(n-2);
    }
}

private static char[] getBirthDate(String id) {
		// TODO Auto-generated method stub
		return null;
}

private static void convertToIntDigits(String[] strDigits) {
	int b[] = null;
	System.out.println("[");
	for(int i=0;strDigits[i].equals(null);i++){
		if(i!=0)System.out.println(",");
		b[i]=Integer.parseInt(strDigits[i]);
		System.out.println(b[i]);
	}
	System.out.println("]");
}

private static int convertStr2Choice(String strChoice) {
	if(strChoice.equals("fib"))return 1;
	else if(strChoice.equals("sort"))return 2;
	else if(strChoice.equals("search"))return 3;
	else if(strChoice.equals("getBirthDate"))return 4;
	else return 5;
}

}
